package com.example.administrator.text;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.ListView;

import java.util.ArrayList;

import app.BaseActivity;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import util.HomeUtil;
import util.JumpActivityUtils;

public class ProblemActivity extends BaseActivity {
    private ArrayList<String> mList = new ArrayList<>();

    @Bind(R.id.activity_setnewfiitem_frame)  FrameLayout mFrameLoayout;
    @Bind(R.id.activity_problem)             ListView mListView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setnew_item);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        HomeUtil.getHemeUtilNew().getStatusBar(this, mFrameLoayout);
        ArrayAdapter<String> adapter = new ArrayAdapter<>(
                this,
                R.layout.adapter_problem_item,
                R.id.adapter_problem_listtv_name,
                getData());
        mListView.setAdapter(adapter);
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                JumpActivityUtils.getInstance().jumpProblemItem(ProblemActivity.this,position+"");
            }
        });

    }

    /**
     * 返回
     */
    @OnClick(R.id.activity_setnewfiitem_ll)
    void getFinish(){
        finish();
    }

    private ArrayList<String> getData()
    {
        mList.add("1.押金说明");
        mList.add("2.连不上网");
        mList.add("3.联网失败");
        mList.add("4.如何下载"+getString(R.string.app_name)+"App");
        mList.add("5.WiFi自动切换");
        mList.add("6.如何联系我们");
        return mList;
    }
}
